package com.qianfeng.pojo;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;


/**
 * 创建了User这个实体类，但是它不会自动在数据库中生成相对应的表，使用jpa的注解在数据库中生成相应的表
 * @author MING
 *
 */
@Entity//在数据库中生成表
@Table(name="t_user")//为数据库中的这个表起一个名字，如果不用@Table起名字，默认表名是该类的类名
public class User {

	@Id //将下面的id作为主键
	@GeneratedValue(strategy=GenerationType.IDENTITY)//id自动增长
	private Integer id;
	private String name;
	private String password;
	private String email;
	private  Date birthday;
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
}
